﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views.components.mainmenu {
    import reprise.ui.*;
    import flash.events.*;
    import net.wooga.pets.events.*;

    public class PatientTabDisplay extends AbstractTabView {

        public function addPatient(_arg1:String, _arg2:String, _arg3:String, _arg4:Array, _arg5:String, _arg6:String, _arg7:String):void{
            if (this.getPatientById(_arg1)){
                return;
            };
            removePlaceholders();
            var _local8:PatientScrollItem = new PatientScrollItem(_arg1, _arg2, _arg3, _arg4, _arg7);
            _local8.addEventListener(MouseEvent.CLICK, this.petItem_click);
            m_scrollPane.addItem(_local8);
            _local8.setReadyText(_arg6);
            _local8.setNeedRoomsText(_arg5);
            addPlaceholders();
        }
        public function removePatientById(_arg1:String):void{
            removePlaceholders();
            var _local2:PatientScrollItem = this.getPatientById(_arg1);
            if (_local2){
                m_scrollPane.removeItem(_local2);
                addPlaceholders();
            };
        }
        override protected function addPlaceholder():void{
            var _local1:PlaceholderScrollItem = PlaceholderScrollItem(m_scrollPane.addItem(new PlaceholderScrollItem("petsPlaceholderScrollItem")));
            m_placeholders.push(_local1);
        }
        public function getPatientById(_arg1:String):PatientScrollItem{
            var _local2:UIComponent;
            for each (_local2 in m_scrollPane.items) {
                if ((((_local2 is PatientScrollItem)) && ((PatientScrollItem(_local2).petId == _arg1)))){
                    return (PatientScrollItem(_local2));
                };
            };
            return (null);
        }
        public function showReady(_arg1:String):void{
            var _local2:PatientScrollItem = this.getPatientById(_arg1);
            ((_local2) && (_local2.showReady()));
        }
        public function hideReady(_arg1:String):void{
            var _local2:PatientScrollItem = this.getPatientById(_arg1);
            ((_local2) && (_local2.hideReady()));
        }
        public function highlightCurrentTreatment(_arg1:String, _arg2:String):void{
            var _local3:PatientScrollItem = this.getPatientById(_arg1);
            ((_local3) && (_local3.highlightCurrentTreatment(_arg2)));
        }
        public function setTreatmentTimeLeft(_arg1:String, _arg2:String):void{
            var _local3:PatientScrollItem = this.getPatientById(_arg1);
            ((_local3) && (_local3.setTimeLeft(_arg2)));
        }
        private function petItem_click(_arg1:MouseEvent):void{
            var _local2:PatientScrollItem = PatientScrollItem(_arg1.currentTarget);
            dispatchEvent(new ViewCompEvent(ViewCompEvent.CLICK, _local2.petId));
        }

    }
}//package net.wooga.pets.views.components.mainmenu 
